<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title></title>
  <style>
    body {
      width: 1200px;
      height: 5000px;
    }

    div {
      width: 800px;
      height: 200px;
    }

    .normal:first-child {
      background-color: red;
    }

    .normal:nth-child(2) {
      background-color: orange;
    }

    body .normal:last-child {
    /* body .normal:nth-child(4) { */
      background-color: blue;
    }

    .relative-father {
      background-color: yellow;
      position: relative;
      top: 100px;
      left: 100px;
    }

    .absolute-son {
      height: 50px;
      width: 400px;
    }

    .normal .absolute-son {
      background-color: pink;
      position: absolute;
      top: 250px;
    }

    .relative-father .absolute-son:nth-child(1) {
      background-color: green;
      position: absolute;
      top: -50px;
      left: -50px;
    }

    .relative-father .absolute-son:nth-child(2) {
      background-color: blue;
      position: absolute;
      right: 0;
      top: 50%;
    }
  </style>
  <link href="css/style.css" rel="stylesheet">
</head>

<body>
  <div class="normal">
    正常div，我在第一个，红
    <div class="absolute-son">祖先无定位div,我在第一个里面，粉</div>
  </div>
  <div class="normal">正常div，我在第二个，橙</div>
  <div class="relative-father">
    <div class="absolute-son">
      父相子绝div，父右下100，黄，子1左上50，绿
    </div>
    <div class="absolute-son">
      父相子绝div，父右下100，黄，子2右居中，蓝
    </div>
  </div>
  <div class="normal" >第三个正常div，紫</div>
</body>

</html>
